import { createRouter, createWebHistory } from "vue-router";


const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect:'index'
  },
    {
        path: "/index",
        name: "index",
      component: () => import("../views/Index.vue"),
      children: [
        // 首页
        {
          path: 'dashboard',
          name: 'dashboard',
          component: () => import("../views/Dashboard.vue"),
        },
        // -------运营管理
        // 订单管理
        {
          path: 'order',
          name: 'order',
          component: () => import("../views/operationmanagement/OrderManagement.vue"),
        },
        // 评论管理
        {
          path: 'comments',
          name: 'comments',
          component: () => import("../views/operationmanagement/CommentsReview.vue"),
        },
        // 运费管理
        {
          path: 'freight',
          name: 'freight',
          component: () => import("../views/operationmanagement/FreightManagement.vue"),
        },

        // -------商品管理
        // 商品列表
        {
          path: 'product',
          name: 'product',
          component: () => import("../views/commoditymanagement/ProductList.vue"),
        },
        // 团购商品
        {
          path: 'group',
          name: 'group',
          component: () => import("../views/commoditymanagement/GroupBuyingproduct.vue"),
        },
        // 类目管理
        {
          path: 'category',
          name: 'category',
          component: () => import("../views/commoditymanagement/CategoryManagement.vue"),
        },
         // -------推广管理
        // 广告管理
        {
          path: 'advertising',
          name: 'advertising',
          component: () => import("../views/expandmanagement/AdvertisingManagement.vue"),
        },
        // 优惠卷管理
        {
          path: 'coupon',
          name: 'coupon',
          component: () => import("../views/expandmanagement/CouponManagement.vue"),
        },
          // -------用户管理
        // 会员管理
        {
          path: 'member',
          name: 'member',
          component: () => import("../views/usermanagement/MemberManagement.vue"),
        },
        // 地址管理
        {
          path: 'address',
          name: 'address',
          component: () => import("../views/usermanagement/AddressAdministration.vue"),
        },
          // -------系统管理
        // 系统配置
        {
          path: 'system',
          name: 'system',
          component: () => import("../views/systemmanagement/SystemConfiguration.vue"),
        },
        // 管理员
        {
          path: 'administrator',
          name: 'administrator',
          component: () => import("../views/systemmanagement/Administrator.vue"),
        },
        // 操作日志
        {
          path: 'operate',
          name: 'operate',
          component: () => import("../views/systemmanagement/OperateLog.vue"),
        },
        // 角色管理
        {
          path: 'role',
          name: 'role',
          component: () => import("../views/systemmanagement/RoleManagement.vue"),
        },
      ]
    }
  ],
});

export default router;
